package io;

import java.io.File;
import java.io.IOException;

public class IODemo6 {
    public static void main(String[] args) throws IOException {
        File file=new File("./test2.txt");
        file.createNewFile();
        File src=new File("./test.txt");
        File desc=new File("./test2.txt");//renameTo重命名文件
        //File desc=new File(".aaa/test2.txt");//renameTo移动文件位置
        src.renameTo(desc);
        file.delete();
    }
}
